import sys
from django.conf import settings as django_settings
        
class RequestProcessor(object):
    def __getattr__(self, attr):
        if attr == '__file__':
            # autoreload support in dev server
            return __file__
        else:
            return lambda request: {attr: getattr(request, attr, None)}
sys.modules[__name__ + '.request'] = RequestProcessor()

class SettingsProcessor(object):
    """
    Credits for this goes to http://sciyoshi.com/blog/2008/jul/10/dynamic-django-settings-context-processor/
    """
    def __getattr__(self, attr):
        if attr == '__file__':
            # autoreload support in dev server
            return __file__
        else:
            return lambda request: {attr: getattr(django_settings, attr)}
sys.modules[__name__ + '.settings'] = SettingsProcessor()
